/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mapdigit.practices.compositeui.utility;

import com.mapdigit.practices.compositeui.eventbroker.EventArgs;

/**
 *
 * @author jshen
 */
public class DataEventArgs<TData> extends EventArgs {

    TData data;

    /// <summary>
    /// Initializes the DataEventArgs class.
    /// </summary>
    /// <param name="data">Information related to the event.</param>
    /// <exception cref="ArgumentNullException">The data is null.</exception>
    public DataEventArgs(TData data) {
        if (data == null) {
            throw new IllegalArgumentException("data is null");
        }
        this.data = data;
    }

    /// <summary>
    /// Gets the information related to the event.
    /// </summary>
    public TData getData() {
        return data;
    }

    /// <summary>
    /// Provides a string representation of the argument data.
    /// </summary>
    @Override
    public String toString() {
        return data.toString();
    }
}
